{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Demo on Google Colab\n",
    "\n",
    "##### Open this notebook in colab: \n",
    "https://colab.research.google.com/github/oyam/PanNet-landsat/blob/master/examples/demo_on_colab.ipynb"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Prepare modules"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "!pip install chainercv rasterio\n",
    "!git clone https://github.com/oyam/PanNet-landsat"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Train the model  \n",
    "If you would like to skip this step, please download [pretrained model](https://drive.google.com/drive/folders/1a5qNiB9TfMN52lTbKl8veJkba64Ua9MI?usp=sharing), put it under 'out_model', and use it for prediction. You can edit train.py to use other data source for training."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "!python PanNet-landsat/train.py --gpu 0 --batch_size 8 --epoch 20 --data_dir './data' --out_model_dir './out_model'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Prediction\n",
    "In this example, used images are same as the images used in training phase in terms of location, but captured time is different."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "!python PanNet-landsat/predict.py --gpu 0 --data_dir './data' --out_dir './out' --pretrained_model './out_model/best_model'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Plot results (WIP)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
